This document is an aid for individuals wishing to create skins for Unsanityª Echo and for ones who want to learn more about how Unsanityª Echo works. A minimal knowledge of resource editing (ResEdit or Resorcerer application experience) is required for most tasks; for skinmakers who wish to redefine buttons placement, a basic knowledge of the Metrowerk's Constructor application is required; and of course, if someone wants to create their own skin, some kind of graphic design application is necessary, such as Adobe Photoshop or similar.
Skin Anatomy
A Unsanityª Echo skin is a folder containing one more more files that define it's look, behavior, and information. An Unsanityª Echo skin needs to be placed in Skins folder to be opened correctly.
Every skin folder must contain a special file, named 'Skin Info'; Unsanityª Echo scans for its presence and decides whether the folder is a valid skin package or not. The format of Skin Info file and what should be included in it will be described below.
Other than one mandatory file, Skin Info, skins may contain any number of resource files that contain various pieces of a skin - pictures, movies, fonts, and scripts. Skinmaker decides by himself/herself the organization of the skin.
If some element (such as picture, script, or movie) defined in the current skin can not be found, Unsanityª Echo attempts to fetch it from the Default skin; this way, a skinmaker could easily create skins that don't redefine the button behavior, but just redefine skin graphics.
EchoScript
Unlike all other applications, buttons and other elements (later referred as 'panes' or 'controls') in Unsanityª Echo skins , are not static. This means that skins may contain different panes or controls than ones supplied in the default skin; this also means a skin may contain an arbitrary number of windows - not just the main window, playlist, and browser windows. Such flexibility is achieved by usage of EchoScript, a special simple scripting language that defines behavior of each button, picture, or window. The Unsanityª Echo application itself doesn't know about buttons in its skin windows, and what they are supposed to do; instead, it looks up the script attached to each button and executes it in response to various user actions - such as mouse clicks inside a control, or when user passes mouse over the control, and so on. EchoScript syntax and commands are described in greater detail in another section, EchoScript Reference. It's important to realize that Unsanityª Echo skins are almost as flexible as far as skinmaker imagination goes.
EchoScripts for all panes, windows and controls of Unsanityª Echo skins are stored in 'TEXT' resources, named in special way. When Unsanityª Echo encounters a control, it tries to find a script associated with that control. In most cases, script resources are named as 'EchoScript.<control class>.<control id>', for example a TEXT resource named 'EchoScript.Button.play' contains a script that will be used by button control with ID 'play'.
When Unsanityª Echo finds an EchoScript, it compiles it into a special non-human-readable form, called bytecode . Bytecode scripts are much faster to execute than plain text EchoScript scripts, so Unsanityª Echo automatically compiles TEXT scripts into bytecode if it's newer than the bytecode already found in the skin, or if bytecode version couldn't be found. For us, it just means that a skinmaker shouldn't worry -- Unsanityª Echo will automatically compile a modified script into bytecode form if needed, or it will fetch cached bytecode for needed script.
Skin Object Types
Within a skin, there could be various kinds of objects.
Every Unsanityª Echo skin contains windows . Windows are where all other visible skin elements reside; windows are also what the user sees.
Every Unsanityª Echo window contain panes and controls . Both of them are merely elements that represent buttons, sliders, pictures, movies and so on; the difference between a pane and a control is that user could interact with control, such as clicking on it, but generally can't interact with panes. An example of controls could be buttons or sliders; an example of a pane could be a static picture (such as background picture for the window),or movies.
And finally, as already have mentioned above, most windows, panes and controls refer to another element type, scripts . Script attached to skin elements define what that element will do.